



export const searchRoute = (path, routes) => {
    let result = {};
    for (let item of routes) {
        //递归条件
        
        if (item.path === path)  return item;
        if (item.children) {
            const res = searchRoute(path, item.children);
            if (Object.keys(res).length) result = res;
        }
    }
    
    return result;
};



